// stores/paramsStore.ts
import {defineStore} from 'pinia'
import {ref} from "vue"

export const useOrderParamsStore = defineStore('order', () => {
    const orderParams = ref({
        showOrder: true, // 当前订单页面展示的订单类型：true-商城订单，false-厨房订单
        currentOrder: 0, // 当前订单页面展示的订单类型: 0-全部，1-待付款，2-待发货，3-待收货，4-待评价
    })

    const updateOrderParams = (params: Partial<typeof orderParams.value>) => {
        orderParams.value = {
            ...orderParams.value,
            ...params
        }
    }

    return {
        orderParams,
        updateOrderParams
    }
})